package com.bybops.model.api;

import com.bybops.BuildConfig;
import com.bybops.model.data.AppConfig;

import org.jetbrains.annotations.NotNull;

public class URLConstant {
    /**
     * 配置文件前缀
     */
    public static final String mConfigUrl = "https://sccp-t.naton.cn:9443/";

    /**
     * api接口前缀
     */
    public static  String mApiUrl;
    /**
     * 文件接口前缀
     */
    public static  String mFileUrl;

    /**
     * apk下载地址
     */
    public static  String mApkDownload = "";

    /**
     * 二维码解析前缀
     */
    public static String mPrefix_RQCode;

    static {
        if (BuildConfig.APP_CONFIG_URL_FLAG){
            //正式环境
            mPrefix_RQCode = "https://www.banyibao.net/lockcode/";
            mApiUrl = "https://api.banyibao.net/ops/";
        }else {
            //测试环境
            mPrefix_RQCode = "https://api.banyibao.net/lockcode/";
            mApiUrl = "https://opsapi.yicai.wang/";
        }
    }


    /**
     * 设置接口前缀
     * @param data
     */
    public static void setURL(@NotNull AppConfig data) {
        mApiUrl = data.getApiUrl();
        mFileUrl = data.getDownloadUrl();
        mApkDownload = data.getApkDownload();
    }
}
